<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width">
        <link type="text/css" rel="stylesheet" href="../style/avalon.doc.css"/>
        <script src="../avalon.js"></script>
        <script type="text/javascript">
            require(["dropdownlist/avalon.dropdownlist", "ready!"], function() {
                avalon.define('dropdown', function(vm) {
                    vm.enableDropdownList = function() {
                        avalon.vmodels.a.enable = true
                    }
                    vm.disableDropdownList = function() {
                        avalon.vmodels.a.enable = false
                    }
                });
                avalon.scan();
            });
        </script>
        <script src="../highlight/shCore.js"></script>
    </head>
    <body>
        <div class="wrapper" ms-controller="dropdown">
            <h2>dropdownlist（下拉框）</h2>
            <p>通过设置enable来决定组件的禁用状态</p>
            <select ms-widget="dropdownlist, a">
                <optgroup label="group1">
                    <option value="value1">Value 1</option>
                    <option>textValue</option>
                    <option label="label" value="labelValue">with label</option>
                    <option value="value2" selected>Value 2</option>
                    <option value="value3">Value 3</option>
                </optgroup>
                <optgroup label="group2">
                    <option value="value4">Value 4</option>
                    <option value="value5" disabled>Value 5</option>
                    <option value="value6">Value 6</option>
                </optgroup>
            </select>
            <button ms-click="enableDropdownList" class="btn">Enable</button>
            <button ms-click="disableDropdownList" class="btn">Disable</button>
            <pre class="brush:html;gutter:false;toolbar:false;" ms-skip>
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;script src="../avalon.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
        require(["dropdownlist/avalon.dropdownlist", "ready!"], function() {
            avalon.define('dropdown', function(vm) {
                vm.enableDropdownList = function() {
                    avalon.vmodels.a.enable = true
                }
                vm.disableDropdownList = function() {
                    avalon.vmodels.a.enable = false
                }
            });
            avalon.scan();
        });
    &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;div class="wrapper" ms-controller="dropdown"&gt;
        &lt;h2&gt;dropdownlist（下拉框）&lt;/h2&gt;
        &lt;p&gt;通过设置enable来决定组件的禁用状态&lt;/p&gt;
        &lt;select ms-widget="dropdownlist, a"&gt;
            &lt;optgroup label="group1"&gt;
                &lt;option value="value1"&gt;Value 1&lt;/option&gt;
                &lt;option&gt;textValue&lt;/option&gt;
                &lt;option label="label" value="labelValue"&gt;with label&lt;/option&gt;
                &lt;option value="value2" selected&gt;Value 2&lt;/option&gt;
                &lt;option value="value3"&gt;Value 3&lt;/option&gt;
            &lt;/optgroup&gt;
            &lt;optgroup label="group2"&gt;
                &lt;option value="value4"&gt;Value 4&lt;/option&gt;
                &lt;option value="value5" disabled&gt;Value 5&lt;/option&gt;
                &lt;option value="value6"&gt;Value 6&lt;/option&gt;
            &lt;/optgroup&gt;
        &lt;/select&gt;
        &lt;button ms-click="enableDropdownList" class="btn"&gt;Enable&lt;/button&gt;
        &lt;button ms-click="disableDropdownList" class="btn"&gt;Disable&lt;/button&gt;
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
        </div>
    </body>
</html>